Image data handled in an electronic camera or a computer normally undergo image compression (e.g., JPEG compression) processing, in order to efficiently record the image data at a recording medium. The image compression processing may be executed through, for instance, the following steps 1˜6.
1. The electronic camera determines a target image data compression rate in correspondence to the compressed image quality setting selected by the photographer (e.g., by switching to one of; FINE/NORMAL/BASIC).
2. The electronic camera divides the image data constituted of the brightness Y and the color differences Cb, Cr blocks each made up of, for instance, 8×8 pixels. The electronic camera then implements DCT (discrete cosine transform) in units of the individual blocks resulting from the division and obtains transformation coefficients each corresponding to one of 8×8 discrete spatial frequencies.3. The electronic camera prepares reference quantization tables defining a quantization step in correspondence to each of the 8×8 transformation coefficients. By multiplying the data in the reference quantization tables by a scale factor SF (a type of compression parameter), the electronic camera obtains a quantization table to be utilized in actual processing.4. The electronic camera quantizes each of 8×8 transformation coefficients using the quantization tables obtained in step 3.5. The electronic camera compresses the quantized data by coding the data through variable length coding, run-length coding or the like.6. If the compression size deviates from the allowable target compression rate range, the electronic camera first readjusts the value of the scale factor SF and then re-engages in the operation in step 3 above. If, on the other hand, the compression size is within the allowable target compression rate range, it ends the image compression processing.
Through the processing described above, the image data can be compressed at a compression rate within the allowable target compression rate range.
Under normal circumstances, when compressing image data with a large information volume in an electronic camera, the scale factor SF is set to a relatively high value in order to assure that the compression size is kept within the target compression rate range. When the scale factor SF increases, the step taken to quantize the DC component becomes larger and, as a result, significant quantization noise manifests in the quantized DC component. Such quantization noise in the DC component then manifests as pronounced block noise in the decompressed image.
For instance, when handling data of an image of sunlight filtering through leaves, significant block noise manifests over a flat area such as a tree trunk while no significant block noise manifests over details such as tree leaves and the like.
Block noise resulting from the compression size adjustment may be prevented by implementing a fixed DC component quantization step which does not change regardless of the setting for the scale factor SF. In this case, since the DC component quantization step is fixed, there is no concern that block noise may result from the compression size adjustment.
However, these measures frequently lead to an undesirable phenomenon on the opposite extreme in that if the scale factor SF is set to a relatively small value to process image data with a small information volume, the AC component quantization step becomes smaller than the DC component quantization step. When such a reverse phenomenon occurs, the compression distribution of the DC component/AC component becomes poor and the priority of compression is not given to information which is visually important.
The block noise mentioned above may be prevented by individually adjusting the DC component quantization step and the AC component quantization step. By implementing the individual adjustments, it becomes possible to fully take into consideration all the important factors including the block noise, the compression size and the compression distribution.
However, a greater number of parameters must be adjusted during the compression size adjustment if the individual adjustments mentioned above are implemented. In addition, the effects of the individual parameters on the compression size and the compressed image quality are complex and indeterminate. For this reason, it is difficult to execute the correct compression processing by individually adjusting these parameters during the compression size adjustment. Furthermore, there is another problem in that since the number of options for each parameter increases, the compression size adjustment cannot be completed quickly.